<include file="header" />
<include file="share_header" />
<body>
<div class="wraper hasmenu">
    <div class="center-top tb-mode">
        <div class="tb-cell">
            <p class="text-32">{BEESCRM:$surplusTime}</p>
            <p class="text-18">剩余时长</p>
        </div>
        <div class="tb-cell text-right">
            <a href="/index.php?g=Base&m=ReCharging&a=ChargingRecharge&chargingId={BEESCRM:$chargingId}" class="charge-btn text-16">充值</a>
        </div>


    </div>

    <a href="{BEESCRM::U('/base/ReCharging/chargingMoneyRecord',array('chargingId'=>$chargingId))}" class="lists">
        <div class="tb-mode">
            <p class="tb-cell">
                <span class="iconbox color-1"><span class="iconfont icon-chongdianjilu"></span></span>
                <span>充值记录</span>
            </p>
            <p class="tb-cell text-right"><span class="iconfont icon-you"></span></p>
        </div>
    </a>
    <a href="{BEESCRM::U('/base/ReCharging/chargingRecord',array('chargingId'=>$chargingId))}" class="lists">
        <div class="tb-mode">
            <p class="tb-cell">
                <span class="iconbox color-2"><span class="iconfont icon-iconfonticon07"></span></span>
                <span>充电记录</span>
            </p>
            <p class="tb-cell text-right"><span class="iconfont icon-you"></span></p>
        </div>
    </a>
    <!--<a href="{BEESCRM::U('/base/ReCharging/chargingPreferential',array('chargingId'=>$chargingId))}" class="lists">
        <div class="tb-mode">
            <p class="tb-cell">
                <span class="iconbox color-3"><span class="iconfont icon-youhuiquan"></span></span>
                <span>优惠券</span>
            </p>
            <p class="tb-cell text-right">
                <span class="iconfont icon-youhuiquan1 text-green"></span>
                <span class="iconfont icon-you"></span>
            </p>
        </div>
    </a>-->
    <a href="{BEESCRM::U('/Base/ReCharging/chargingHelpCenter',array('chargingId'=>$chargingId))}" class="lists">
        <div class="tb-mode">
            <p class="tb-cell">
                <span class="iconbox color-4"><span class="iconfont icon-bangzhu"></span></span>
                <span>使用帮助</span>
            </p>
            <p class="tb-cell text-right"><span class="iconfont icon-you"></span></p>
        </div>
    </a>
    <a href="{BEESCRM::U('/Base/ReCharging/chargingAgreement',array('chargingId'=>$chargingId))}" class="lists">
        <div class="tb-mode">
            <p class="tb-cell">
                <span class="iconbox color-5"><span class="iconfont icon-hehuoxieyi"></span></span>
                <span>用户协议</span>
            </p>
            <p class="tb-cell text-right"><span class="iconfont icon-you"></span></p>
        </div>
    </a>
    <!--or $chargingId eq 12-->
    <if condition = "$is_refund eq 1">
        <a href="#" class="lists" id="refund">
            <div class="tb-mode">
                <p class="tb-cell">
                    <span class="iconbox color-5"><span class="iconfont icon-tuikuan"></span></span>
                    <span>申请余额退款</span>
                </p>
                <p class="tb-cell text-right"><span class="iconfont icon-you"></span></p>
            </div>
        </a>
    </if>
    <a href="#" class="lists">
        <div class="tb-mode">
            <p class="tb-cell">
                <span class="iconbox color-6"><span class="iconfont icon-gengduo"></span></span>
                <span>敬请期待</span>
            </p>
            <!--<p class="tb-cell text-right"><span class="iconfont icon-you"></span></p>-->
        </div>
    </a>
    <!--<if condition="$chargingId eq 12 or $chargingId eq 3">-->
         <!--<a  id="refund" href="#" class="lists" style="text-align:center">申请余额退款</a>-->
    <!--</if>-->
        
    <include file="nav"/>
</div>
<include file="commonJS"/>
<script>
    seajs.use(['$','layer'], function() {
        wx.ready(function(){
            $('.scan_code').on('click',function(){
                wx.scanQRCode({
                    needResult: 0, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
                    scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
                    success: function (res) {
                        var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
                    }
                });
            })
        });
        $(function () {
            //退款
            $('#refund').on('click', function () {
                var msg = '申请退款后剩余时长将清0,进入待退款状态，是否继续？';
                fm.confirm(msg, function (a) {
                    if(a == 1){
                        drop();
                    } else {
                        fm.alert('您已取消操作！')
                    }
                });
                function drop() {
                    $.ajax({
                        url: "{BEESCRM::U('Base/ReCharging/applyRefund',array('chargingId'=>$chargingId))}",
                        dataType: "json",
                        success: function (res) {
                            if (res.status == 'S') {
                                fm.alert( res.message);
                                setTimeout(reload,2000);
                            } else {
                                fm.alert(res.message);
                            }
                        }
                    });
                }
                function reload() {
                    setTimeout(location.reload(),3000);
                }
            });
        })
    })
</script>
</body>
</html>